package com.crr.mall.product.dao;

import com.crr.mall.product.entity.CategoryEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 * 
 * @author chenrenren
 * @email chenrenren@gmail.com
 * @date 2024-11-22 17:42:37
 */
@Mapper
public interface CategoryDao extends BaseMapper<CategoryEntity> {
    /**
     * 根据父id查询子
     * @param parentId
     * @return
     */
    List<Map> queryTree(int parentId);

    /**
     * 根据id批量删除
     * @return
     */
    int removeMenusByIds(List<Long> ids);


    List<CategoryEntity> queryLevelByOne(@Param("level") long level);

    List<CategoryEntity> queryByOneId(@Param("ids") List<Long> ids);
}
